home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11292 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.8 KB

  1. Path: ra.nrl.navy.mil!usenet
  2. From: pitre@n5160d.nrl.navy.mil (Richard Pitre)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Will JAVA kill C++?
  5. Date: 13 Mar 1996 15:34:02 GMT
  6. Organization: Naval Research Laboratory
  7. Message-ID: <4i6ptb$36o@ra.nrl.navy.mil>
  8. References: <31471A61.3510@sdt.com>
  9. NNTP-Posting-Host: n5160d.nrl.navy.mil
  10.  
  11. In article <31471A61.3510@sdt.com> Larry Baker <leb@sdt.com> writes:
  12. > Adam Megacz wrote:
  13. > > I'm not a Fortran buff, but I don't understand why C is faster
  14. > > than C++. C++ supports all C features (except the void* crap).
  15. > > If anything, C++'s type-checking allows more compiler
  16. > > optimizations, making it a slightly faster language.
  17. > If you code _exactly_ the same way using a C++ compiler, in
  18. > essence using the C++ compiler to compile a "C" program, then
  19. > you should see no performance difference on non-optimized code.
  20. > C vs Fortran raises a few other interesting comparisons. All variables
  21. > in FORTRAN are the equivalant of C "static" types - they aren't
  22. > dynamically pushed/popped off of the stack, as with automatic C
  23. > variables, or dynamically allocated using malloc/free, as they
  24. > may be (even as automatic, stack-based instances) in C++.  Hence
  25. > the C runtime semantics, and moreso the C++ runtime semantics, may
  26. > incur some slight "background" overhead when compared to a much
  27. > simpler language like FORTRAN.
  28. > Larry Baker
  29. > leb@sdt.com
  30.  
  31. I agree with what Larry is saying. A programmer, who has some sense of how C,  
  32. C++, and Fortran are typically implemented, can do everything efficiently in  
  33. C++ with the added advantage of classes. C++ gives you fine control over  
  34. efficiency and organization and the compromise between them. 
  35.  
  36. IMHO C++ is a tool only for experienced and disciplined professionals. I think  
  37. that it is important for programmers to understand the motivational issues  
  38. behind the C++ features and the place to find that motivation is in  
  39. Stroustrup's excellent writings. Some people complain about the difficulty of  
  40. these books but I believe that much of the difficulty is inherent in the  
  41. subject i.e. C++ is complex and subtle to the point that people seem to have  
  42. difficulty in correctly implementing some of its more useful features. This  
  43. reading should be a sober experience for anyone making claims for C++ as an  
  44. ideal all purpose tool for the programming masses. The notion that less  
  45. experienced programmers will somehow confine themselves to a somewhat safe  
  46. subset of the language is a foolish notion. The popularity of C/C++ is a  
  47. serious problem not only for people who need other tools but perhaps for the  
  48. future of C/C++ itself.  
  49.  
  50. Beginning and intermediate programmers should use something other than C++  
  51. until they understand what programming is really about. Pascal lineage  
  52. programming tools(and perhaps JAVA) are good alternatives for beginning,  
  53. intermediate and many professional programmers, although as Larry pointed out  
  54. these languages are largely non existent thanks to the gross over popularity of  
  55. C/C++. Of the Pascal lineage languages Ada95 is a real standard that seems to  
  56. have significant multiplatform support and there is some inkling of a  
  57. competitive compiler market. Ada also has some heavy duty annexes to do real  
  58. world things. Modula 3 may also be a practical choices for many.  
  59.  
  60. After some experience with tamer languages and  after reading something on the  
  61. order of Stroustrup's books, a programmer can make a conscious choice to use  
  62. C++. Many programmers may conclude that, in spite of their experience, they do  
  63. not have the necessary discipline to code in C++. If every programmer could  
  64. make that kind of conscious decision then there would be healthier software out  
  65. there and there would be serious competitive alternatives to the supposed one  
  66. true tool. Dreamland, I know.
  67.  
  68. richard
  69.